package com.dingqb.ktdemo.oop.javad

import java.io.Serializable
import java.text.SimpleDateFormat
import java.util.*

class UseJava : Serializable, Runnable {
    override fun run() {
        for (i in 0..100) {
            Thread.sleep(10);
            System.err.println("i==$i" + Thread.currentThread().name);
        }
    }

}

fun main() {
    userJavaApi();
    for (i in 0..100) {
        var useJava = UseJava();
        var thread = Thread(useJava);
        thread.start();
    }


}

fun userJavaApi() {
    var date = Date();
    var simpleDateFormat = SimpleDateFormat("yyyy-MM-dd-HH:mm:ss:SSS");
    var strTime = simpleDateFormat.format(date);
    println(strTime);

}